home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v08i027: GB2 - Galactic Bloodshed, an empire-like war game [Ver. 1.0], Patch1b
- Message-ID: <4576@tekred.CNA.TEK.COM>
- Date: 15 Sep 89 15:26:27 GMT
- Sender: nobody@tekred.CNA.TEK.COM
- Lines: 1977
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: VANCLEEF@mps.ohio-state.edu
- Posting-number: Volume 8, Issue 27
- Archive-name: GB2/Patch1b
- Patch-To: GB2: Volume 7, Issue 44-51
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 4)."
- # Contents: patches01b
- # Wrapped by billr@saab on Fri Sep 15 08:21:57 1989
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patches01b' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patches01b'\"
- else
- echo shar: Extracting \"'patches01b'\" \(52681 characters\)
- sed "s/^X//" >'patches01b' <<'END_OF_FILE'
- X*** ../../GB2/enrol.c Wed Jul 5 15:15:14 1989
- X--- enrol.c Fri Sep 15 07:27:57 1989
- X***************
- X*** 23,33 ****
- X compatible with everything. */
- X float Likes[DES_PLATED+1][DES_PLATED+1] = {
- X /* DES_SEA DES_LAND DES_MOUNT DES_GAS DES_ICE DES_PLATED*/
- X! /*DES_SEA */ 1.0, 0.0, 0.0, 0.3, 0.05, 1.0,
- X /*DES_LAND */ 0.0, 1.0, 0.5, 0.0, 0.1, 1.0,
- X /*DES_MOUNT*/ 0.0, 0.5, 1.0, 0.0, 0.3, 1.0,
- X /*DES_GAS */ 0.5, 0.0, 0.0, 1.0, 0.0, 1.0,
- X! /*DES_ICE */ 0.05, 0.15, 0.3, 0.0, 1.0, 1.0,
- X /*DES_PLATED*/ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
- X };
- X
- X--- 23,33 ----
- X compatible with everything. */
- X float Likes[DES_PLATED+1][DES_PLATED+1] = {
- X /* DES_SEA DES_LAND DES_MOUNT DES_GAS DES_ICE DES_PLATED*/
- X! /*DES_SEA */ 1.0, 0.0, 0.0, 0.3, 0.1, 1.0,
- X /*DES_LAND */ 0.0, 1.0, 0.5, 0.0, 0.1, 1.0,
- X /*DES_MOUNT*/ 0.0, 0.5, 1.0, 0.0, 0.3, 1.0,
- X /*DES_GAS */ 0.5, 0.0, 0.0, 1.0, 0.0, 1.0,
- X! /*DES_ICE */ 0.1, 0.15, 0.3, 0.0, 1.0, 1.0,
- X /*DES_PLATED*/ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
- X };
- X
- X***************
- X*** 46,52 ****
- X char *loginname;
- X {
- X int x,y, or;
- X! int pnum,star=0,found=0,i,j,enroll_pdata,
- X ifd, enroll_sectdata, enroll_stardata,mask,ppref = -1;
- X char str[100], c;
- X sectortype *sect;
- X--- 46,52 ----
- X char *loginname;
- X {
- X int x,y, or;
- X! int pnum,star=0,found=0,vacant,count,i,j,enroll_pdata,
- X ifd, enroll_sectdata, enroll_stardata,mask,ppref = -1;
- X char str[100], c;
- X sectortype *sect;
- X***************
- X*** 73,78 ****
- X--- 73,79 ----
- X exit(0);
- X }
- X
- X+
- X /* look at enroll screen */
- X sprintf(str, "%s %s", PAGER, ENROLL_FL);
- X system(str);
- X***************
- X*** 98,129 ****
- X }
- X
- X /* find first planet of right type */
- X! star = 0; found = 0;
- X! while (!found && star<Sdata.numstars) {
- X! for (or=i=0; i<howmanybytes(Playernum); i++ )
- X! or |= Stars[star]->explored[i];
- X! /* make sure no one has explored the star */
- X! if (!or) {
- X pnum = 0;
- X while (!found && pnum<Stars[star]->numplanets) {
- X openpdata(&enroll_pdata);
- X getplanet(enroll_pdata,&planet,Stars[star]->planetpos[pnum]);
- X! if (planet->type==ppref) {
- X found = 1;
- X! } else {
- X! close(enroll_pdata);
- X! free(planet);
- X! pnum++;
- X! }
- X }
- X! }
- X if (!found)
- X! star++;
- X! }
- X
- X
- X if (!found) {
- X! printf(" Uhoh, there don't seem to be any of that type of planet left.\n");
- X not_found[ppref] = 1;
- X for (found=1,i=TYPE_EARTH; i<=TYPE_GASGIANT; i++)
- X found &= not_found[i];
- X--- 99,142 ----
- X }
- X
- X /* find first planet of right type */
- X! count = 0;
- X! star = int_rand(0,Sdata.numstars);
- X! found = 0;
- X! while (!found && count < 100) {
- X! /* look for unihabited planets */
- X!
- X pnum = 0;
- X while (!found && pnum<Stars[star]->numplanets) {
- X openpdata(&enroll_pdata);
- X getplanet(enroll_pdata,&planet,Stars[star]->planetpos[pnum]);
- X!
- X! vacant = 1;
- X! for (i=0; i<Playernum-1; i++ )
- X! {
- X! if (planet->info[i].numsectsowned != 0) vacant = 0;
- X! }
- X!
- X! if(vacant && planet->type==ppref)
- X! {
- X found = 1;
- X! } else {
- X! close(enroll_pdata);
- X! free(planet);
- X! pnum++;
- X! }
- X }
- X!
- X if (!found)
- X! {
- X! count ++;
- X! star = int_rand(0,Sdata.numstars);
- X! }
- X
- X
- X+ }
- X+
- X if (!found) {
- X! printf(" planet type not found after 100 systems randomly searched.");
- X not_found[ppref] = 1;
- X for (found=1,i=TYPE_EARTH; i<=TYPE_GASGIANT; i++)
- X found &= not_found[i];
- X***************
- X*** 210,216 ****
- X printw(" Adventurists: %.2f\n",Race->nonhomebodies);
- X printw(" Mass: %.2f\n",Race->mass);
- X printw(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
- X! printw("\n\n (%d re-rolls left) * type spacebar ' ' to reroll :", --i);
- X refresh();
- X if (getchr()!=' ')
- X found = 1;
- X--- 223,229 ----
- X printw(" Adventurists: %.2f\n",Race->nonhomebodies);
- X printw(" Mass: %.2f\n",Race->mass);
- X printw(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
- X! printw("\n\n (%d re-rolls left) space to reroll:", --i);
- X refresh();
- X if (getchr()!=' ')
- X found = 1;
- X***************
- X*** 280,286 ****
- X planet->info[Playernum-1].numsectsowned = 1;
- X planet->is_explored = 0;
- X planet->info[Playernum-1].explored = 1;
- X! planet->info[Playernum-1].autorep = 1;
- X
- X
- X sect->owner = Playernum;
- X--- 293,299 ----
- X planet->info[Playernum-1].numsectsowned = 1;
- X planet->is_explored = 0;
- X planet->info[Playernum-1].explored = 1;
- X! /*planet->info[Playernum-1].autorep = 1;*/
- X
- X
- X sect->owner = Playernum;
- X*** ../../GB2/enroll.dat Wed Jul 5 15:15:55 1989
- X--- enroll.dat Fri Sep 15 07:28:55 1989
- X***************
- X*** 7,13 ****
- X
- X
- X Welcome to
- X! Galactic Bloodshed Version 0.975
- X Written by Robert Chansky
- X
- X
- X--- 7,13 ----
- X
- X
- X Welcome to
- X! Galactic Bloodshed
- X Written by Robert Chansky
- X
- X
- X***************
- X*** 26,31 ****
- X--- 26,75 ----
- X
- X
- X
- X+
- X+ Version 1.1 (ohio state)
- X+ 9/15/89
- X+
- X+ Adapted from the original program by
- X+
- X+ Robert Chansky
- X+ Univ. California/Santa Cruz
- X+
- X+
- X+ modifications programmed by
- X+
- X+ Garrett Van Cleef, Ph.D
- X+ Dept. of Physics
- X+ The Ohio State University
- X+
- X+
- X+
- X+
- X+
- X+
- X+
- X+
- X+ V1.0 playtesting by
- X+
- X+ Hanan Baddar
- X+ Ken Bloch
- X+ John Davis
- X+ Robert Jones
- X+ Menelaos Kafkaladis
- X+ Brett Lowry
- X+ Paul Murphy
- X+ Garrett van Cleef
- X+ Wolfgang Wenzel
- X+
- X+ -----
- X+
- X+ Dept. of Physics
- X+ The Ohio State University
- X+
- X+
- X+
- X+
- X+
- X You look around in the slime.
- X
- X Isn't there, you think, something more to life?
- X***************
- X*** 65,70 ****
- X--- 109,119 ----
- X 9 #####.#########-####################### <-- Ice (polar cap)
- X
- X
- X+
- X+
- X+
- X+
- X+
- X Gasgiant Planet Airless Planet
- X 000000000011111111112222222222333333333 0000000000111111111122
- X 012345678901234567890123456789012345678 0123456789012345678901
- X*** ../../GB2/enslave.c Wed Jul 5 15:15:15 1989
- X--- enslave.c Fri Sep 15 07:27:58 1989
- X***************
- X*** 97,103 ****
- X
- X openshdata(&enslave_shdata);
- X sh = p->ships;
- X- Locks(1);
- X while (sh) {
- X (void)getship(enslave_shdata, &s2, sh);
- X if (p->info[s2->owner].numsectsowned && s2->owner!=Playernum)
- X--- 97,102 ----
- X***************
- X*** 107,113 ****
- X sh = s2->nextship;
- X free(s2);
- X }
- X- Locks(0);
- X close(enslave_shdata);
- X
- X deductAPs(APcount, s->storbits, 0);
- X--- 106,111 ----
- X*** ../../GB2/exam.dat Wed Jul 5 15:15:56 1989
- X--- exam.dat Fri Sep 15 07:28:57 1989
- X***************
- X*** 13,19 ****
- X with this extra cargo. Shuttles are one of the few classes of ships that can
- X construct other ships.
- X ~
- X! Dreadnaught
- X This is a well-armored but large (and slow due to it's mass)
- X interstellar warship.
- X
- X--- 13,43 ----
- X with this extra cargo. Shuttles are one of the few classes of ships that can
- X construct other ships.
- X ~
- X! Carrier
- X!
- X! A must for every fleet. The carriers are similar to current and past
- X! aircraft carriers in both a strategic and tactical sense. They have
- X! relatively small gunnery strengths and defensive capabilities, however,
- X! these deficiencies are far outweighed by their ability to transport
- X! large amounts of fighter craft for use in battle. This makes these
- X! ships dominant components of any battle fleet.
- X!
- X! Each carrier can transport an unlimited number of fighters, however,
- X! the mass of the carrier and its fighters as well as overhead requirements
- X! of the fighters will set a 'realistic' limit of the numbers that
- X! individual players may want to carry. If a carrier gets destroyed for
- X! whatever reason, all docked fighters will also be destroyed.
- X!
- X! The docking of fighters and carriers is handled differently than that
- X! between other ships. The fighter must be designated as the first ship in
- X! the docking command with the carrier as designated secondly. This will
- X! add the fighter to the linked list of fighters designated to the
- X! carrier and remove it from the list of ships orbiting a star/planet.
- X! These will not show up on the 'report' and similar displays unless the
- X! scope is set to the carrier. At this level all attached fighters are
- X! displayed.
- X!
- X! ~Dreadnaught
- X This is a well-armored but large (and slow due to it's mass)
- X interstellar warship.
- X
- X***************
- X*** 39,67 ****
- X This is a well-protected and fast light cruiser, suitable for
- X escort.
- X ~
- X! Fighter
- X! A small fuel capacity and high armor class makes this ship ideal
- X! for in-system combat.
- X ~
- X- Cargo ship
- X- This is a long-range interstellar transport craft, with little
- X- weapons or armor.
- X- ~
- X Explorer
- X This is a small and fast long-range exploration craft with almost no
- X weapons capacity but some armor.
- X ~
- X! Tanker
- X! This ship can carry large amounts of fuel; it can also receive more
- X! fuel by orbiting a gas giant.
- X ~
- X-
- X Space Station
- X
- X This is an orbital military installation useful as a military depot
- X as well as a planetary defense perimeter.
- X
- X-
- X ~
- X
- X Orbital Assault Platform
- X--- 63,97 ----
- X This is a well-protected and fast light cruiser, suitable for
- X escort.
- X ~
- X! Fighter Group
- X! A small fuel capacity and high armor class makes these ships ideal
- X! for in-system combat. The tactical advantage of these ships coupled with
- X! their ability to be transported on carriers make these ships valuable assets
- X! in combat. Fighter groups represent up to 5 individual craft at full strength.
- X! This interpretation, however, is unimportant with the scale of the game.
- X!
- X ~
- X Explorer
- X This is a small and fast long-range exploration craft with almost no
- X weapons capacity but some armor.
- X+
- X ~
- X! Space Habitat
- X! This is a residential platform, a space colony. It can be used to
- X! manufacture other ships, as well as safeguard your race against extinction,
- X! if you choose to send it into interstellar space as an insurance measure.
- X! Habitats also have sophisticated manufacturing and refining
- X! equipment, enabling the habitat to multiply resources it is carrying, in
- X! proportion to the number of people staffing it.
- X! Habitats are the only ships in which citizens feel comfortable
- X! enough to reproduce freely, although at a reduced rate because of the
- X! crowded conditions.
- X ~
- X Space Station
- X
- X This is an orbital military installation useful as a military depot
- X as well as a planetary defense perimeter.
- X
- X ~
- X
- X Orbital Assault Platform
- X***************
- X*** 70,77 ****
- X recalcitrant worlds (with the 'enslave' command). It can also be used
- X for constructing other ships as can shuttles and habitats, however it
- X cannot reproduce citizens or manufacture resources.
- X- This device cannot be used to enslave.
- X ~
- X GODSHIP
- X This entity pulsates, throbs with power. Don't mess with it.
- X ~
- X--- 100,116 ----
- X recalcitrant worlds (with the 'enslave' command). It can also be used
- X for constructing other ships as can shuttles and habitats, however it
- X cannot reproduce citizens or manufacture resources.
- X ~
- X+
- X+ Cargo ship
- X+ This is a long-range interstellar transport craft, with little
- X+ weapons or armor.
- X+ ~
- X+ Tanker
- X+ This ship can carry large amounts of fuel; it can also receive more
- X+ fuel by orbiting a gas giant.
- X+ ~
- X+
- X GODSHIP
- X This entity pulsates, throbs with power. Don't mess with it.
- X ~
- X***************
- X*** 82,88 ****
- X irradiated, become immobile for a certain amount of time; each turn, an
- X affected ship's crew is reduced by about 10%.
- X The mine can be armed/disarmed with order, and its trigger radius
- X! (0 <= trigger radius <= 200) also altered with the order command.
- X ~
- X Space mirror
- X This is a large plane of reflecting material, suitable for altering
- X--- 121,133 ----
- X irradiated, become immobile for a certain amount of time; each turn, an
- X affected ship's crew is reduced by about 10%.
- X The mine can be armed/disarmed with order, and its trigger radius
- X! also altered with the order command.
- X! Alien space mines are difficult to detect. They are invisible on the
- X! solar system maps but can be detected with the `tactical' command.
- X! Their precise locations may be difficult to triangulate. They also possess
- X! a high defense strength since they are small objects and difficult to hit
- X! nonetheless find.
- X!
- X ~
- X Space mirror
- X This is a large plane of reflecting material, suitable for altering
- X***************
- X*** 91,108 ****
- X
- X ~
- X
- X- Space Habitat
- X- This is a residential platform, a space colony. It can be used to
- X- manufacture other ships, as well as safeguard your race against extinction,
- X- if you choose to send it into interstellar space as an insurance measure.
- X- Habitats also have sophisticated manufacturing and refining
- X- equipment, enabling the habitat to multiply resources it is carrying, in
- X- proportion to the number of people staffing it.
- X- Habitats are the only ships in which citizens feel comfortable
- X- enough to reproduce freely, although at a reduced rate because of the
- X- crowded conditions.
- X- ~
- X-
- X Space telescope
- X This is a space-based astronomical facility, with fuel and engines
- X for launching it into orbit. it has a much longer range than a
- X--- 136,141 ----
- X***************
- X*** 123,129 ****
- X Atmosphere processor
- X This is a large machine (of the type in _Aliens_) that sucks in
- X the atmosphere of a planet, converting it to the type of air preferred by its
- X! owner. This process has a cost of 4 fuel units per turn.
- X ~
- X Canister of dust
- X This is a small canister of light-absorbing dust. When launched it
- X--- 156,163 ----
- X Atmosphere processor
- X This is a large machine (of the type in _Aliens_) that sucks in
- X the atmosphere of a planet, converting it to the type of air preferred by its
- X! owner. This process has a cost of 6 fuel units per turn. You must load
- X! fuel and crew into these objects for them to operate.
- X ~
- X Canister of dust
- X This is a small canister of light-absorbing dust. When launched it
- X***************
- X*** 150,156 ****
- X cloak radius, until whole systems can be cloaked.
- X This is a non-functional device.
- X ~
- X- emotion suppressor
- X Orbital Mind-control laser
- X This device, when aimed at a ship, produces resonating vibrations
- X within the ship's hull, to cause the mental attitude of the crew to
- X--- 184,189 ----
- X***************
- X*** 180,186 ****
- X This is a brilliant necklace of obvious power.
- X This is a non-functional device.
- X ~
- X! gamma ray laser
- X This device fires a deadly stream of radiation at its target when
- X fired. It uses destructive capacity in the same manner other ships use it
- X for their guns. Radiation is not accumulated in target ships; if a ship's
- X--- 213,219 ----
- X This is a brilliant necklace of obvious power.
- X This is a non-functional device.
- X ~
- X! Gamma ray laser
- X This device fires a deadly stream of radiation at its target when
- X fired. It uses destructive capacity in the same manner other ships use it
- X for their guns. Radiation is not accumulated in target ships; if a ship's
- X***************
- X*** 226,229 ****
- X--- 259,278 ----
- X the presence of something in the hopper, it will transport this material into
- X the hopper of its target device. This process takes fuel. The target device
- X can be specified with the order command.
- X+
- X+ You should specify the number of the receiving transporter. If the
- X+ target ship is set to `0' cargo will not be transported anywhere and will
- X+ remain in the hopper.
- X ~
- X+
- X+ Sector repair
- X+ This represents resources spent to repair environmental and structural
- X+ damage in a sector due to severe combat. This 'ship' is built in a sector
- X+ that is currently wasted '%' and reairs it for the listed cost. The repair
- X+ of the sector is considered complete and no repair unit per se is ever
- X+ displayed on the map (it is considered to represent effort and not a particular
- X+ vehicle). You must have resources available on the planet being repaired in
- X+ order to create repair units (population is not necessary).
- X+
- X+ ~
- X+
- X*** ../../GB2/examine.c Wed Jul 5 15:15:16 1989
- X--- examine.c Fri Sep 15 07:27:59 1989
- X***************
- X*** 30,36 ****
- X return;
- X }
- X
- X! if (ship->is_dead) {
- X printf("that ship is dead.\n");
- X free(ship);
- X close(shdata);
- X--- 30,36 ----
- X return;
- X }
- X
- X! if (!ship->is_alive) {
- X printf("that ship is dead.\n");
- X free(ship);
- X close(shdata);
- X*** ../../GB2/files.h Wed Jul 5 15:14:53 1989
- X--- files.h Fri Sep 15 07:27:37 1989
- X***************
- X*** 51,54 ****
- X #define PLAYER_GOD "vancleef"
- X #define GOD_PASSWORD "god"
- X #define PLAYER_GROUP_ID 937
- X-
- X--- 51,53 ----
- X*** ../../GB2/files_shl.c Wed Jul 5 15:15:20 1989
- X--- files_shl.c Fri Sep 15 07:28:01 1989
- X***************
- X*** 73,79 ****
- X printf("unable to open %s\n",PLANETDATAFL);
- X exit(-1);
- X }
- X- /*printf("openpdata %d\n",*fd);*/
- X }
- X
- X
- X--- 73,78 ----
- X***************
- X*** 90,101 ****
- X
- X
- X
- X-
- X getsdata(fd,S)
- X int fd;
- X struct stardata *S;
- X {
- X Fileread(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
- X }
- X
- X
- X--- 89,101 ----
- X
- X
- X
- X getsdata(fd,S)
- X int fd;
- X struct stardata *S;
- X {
- X+ /**/ Locks(1);
- X Fileread(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 110,118 ****
- X printf("unable to open %s\n",RACEDATAFL);
- X exit(-1);
- X }
- X! /*printf(" getrace rnum %d posn %d.\n",rnum,(rnum-1)*sizeof(racetype) );*/
- X Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
- X (rnum-1)*sizeof(racetype) );
- X close(fd);
- X }
- X
- X--- 110,119 ----
- X printf("unable to open %s\n",RACEDATAFL);
- X exit(-1);
- X }
- X! /**/Locks(1);
- X Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
- X (rnum-1)*sizeof(racetype) );
- X+ /**/Locks(0);
- X close(fd);
- X }
- X
- X***************
- X*** 123,130 ****
- X--- 124,133 ----
- X int star;
- X {
- X *s = (startype *)malloc(sizeof(startype));
- X+ /**/Locks(1);
- X Fileread(fd,(char *)*s, sizeof(startype), STARDATAFL,
- X (int)(sizeof(Sdata)+star*sizeof(startype)) );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 134,141 ****
- X int filepos;
- X {
- X *p = (planettype *)malloc(sizeof(planettype));
- X Fileread(fd,(char *)*p, sizeof(planettype), PLANETDATAFL, filepos );
- X! /*printf(" getplanet pointer=%x, smappos=%d\n",*p,(*p)->sectormappos);*/
- X }
- X
- X
- X--- 137,145 ----
- X int filepos;
- X {
- X *p = (planettype *)malloc(sizeof(planettype));
- X+ /**/Locks(1);
- X Fileread(fd,(char *)*p, sizeof(planettype), PLANETDATAFL, filepos );
- X! Locks(0);
- X }
- X
- X
- X***************
- X*** 145,151 ****
- X--- 149,157 ----
- X int filepos;
- X {
- X *s = (sectortype *)malloc(sizeof(sectortype));
- X+ /**/Locks(1);
- X Fileread(fd,(char *)*s, sizeof(sectortype), SECTORDATAFL, filepos );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 154,162 ****
- X sectortype *map;
- X planettype *p;
- X {
- X! /*printf(" getting map posn %d\n", p->sectormappos);*/
- X Fileread(fd,(char *)map, p->Maxx * p->Maxy * sizeof(sectortype),
- X SECTORDATAFL, p->sectormappos);
- X }
- X
- X
- X--- 160,169 ----
- X sectortype *map;
- X planettype *p;
- X {
- X! /**/Locks(1);
- X Fileread(fd,(char *)map, p->Maxx * p->Maxy * sizeof(sectortype),
- X SECTORDATAFL, p->sectormappos);
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 172,180 ****
- X--- 179,190 ----
- X printf("Illegal ship number %d\n",shipnum);
- X return 0;
- X } else {
- X+ /**/Locks(1);
- X *s = (shiptype *)malloc(sizeof(shiptype));
- X Fileread(fd, (char *)*s, sizeof(shiptype), SHIPDATAFL,
- X (shipnum-1)*sizeof(shiptype) );
- X+ Locks(0);
- X+
- X return 1;
- X }
- X }
- X***************
- X*** 213,225 ****
- X exit(-1);
- X }
- X /* put topmost entry in fpos */
- X Fileread(fd, (char *)&shnum, sizeof(short), SHIPFREEDATAFL,
- X buf.st_size - sizeof(short) );
- X /* erase that entry, since it will now be filled */
- X ftruncate(fd, (long)(buf.st_size-sizeof(short)) );
- X close(fd);
- X- if (shnum == 0)shnum=-1;
- X-
- X return (int)shnum;
- X } else
- X return -1;
- X--- 223,235 ----
- X exit(-1);
- X }
- X /* put topmost entry in fpos */
- X+ /**/Locks(1);
- X Fileread(fd, (char *)&shnum, sizeof(short), SHIPFREEDATAFL,
- X buf.st_size - sizeof(short) );
- X /* erase that entry, since it will now be filled */
- X ftruncate(fd, (long)(buf.st_size-sizeof(short)) );
- X+ /**/Locks(0);
- X close(fd);
- X return (int)shnum;
- X } else
- X return -1;
- X***************
- X*** 231,237 ****
- X--- 241,249 ----
- X int fd;
- X struct stardata *S;
- X {
- X+ Locks(1);
- X Filewrite(fd,(char *)S, sizeof(struct stardata), STARDATAFL, 0 );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 245,252 ****
- X--- 257,266 ----
- X printf("unable to open %s\n",RACEDATAFL);
- X exit(-1);
- X }
- X+ Locks(1);
- X Filewrite(fd,(char *)r, sizeof(racetype), RACEDATAFL,
- X (r->Playernum-1)*sizeof(racetype) );
- X+ Locks(0);
- X close(fd);
- X /*printf(" putrace pl#%d posn %d\n",r->Playernum,(r->Playernum-1)*sizeof(racetype) );*/
- X }
- X***************
- X*** 257,264 ****
- X--- 271,280 ----
- X startype *s;
- X int snum;
- X {
- X+ Locks(1);
- X Filewrite(fd,(char *)s, sizeof(startype), STARDATAFL,
- X (int)(sizeof(Sdata)+snum*sizeof(startype)) );
- X+ Locks(0);
- X }
- X
- X putplanet(fd,p,filepos)
- X***************
- X*** 266,272 ****
- X--- 282,290 ----
- X planettype *p;
- X int filepos;
- X {
- X+ Locks(1);
- X Filewrite(fd,(char *)p, sizeof(planettype), PLANETDATAFL, filepos );
- X+ Locks(0);
- X }
- X
- X putsector(fd,s,filepos)
- X***************
- X*** 274,280 ****
- X--- 292,300 ----
- X sectortype *s;
- X int filepos;
- X {
- X+ Locks(1);
- X Filewrite(fd,(char *)s, sizeof(sectortype), SECTORDATAFL, filepos );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 283,290 ****
- X--- 303,312 ----
- X sectortype *map;
- X planettype *p;
- X {
- X+ Locks(1);
- X Filewrite(fd, (char *)map,
- X p->Maxx * p->Maxy * sizeof(sectortype), SECTORDATAFL, p->sectormappos);
- X+ Locks(0);
- X }
- X
- X putship(fd,s,shipnum)
- X***************
- X*** 292,299 ****
- X--- 314,323 ----
- X shiptype *s;
- X int shipnum;
- X {
- X+ Locks(1);
- X Filewrite(fd,(char *)s, sizeof(shiptype), SHIPDATAFL,
- X (shipnum-1)*sizeof(shiptype) );
- X+ Locks(0);
- X }
- X
- X
- X***************
- X*** 341,346 ****
- X--- 365,372 ----
- X
- X shipno = shipnum; /* conv to u_short */
- X
- X+ if(shipnum == 0)return;
- X+
- X if ( (fd = open(SHIPFREEDATAFL, O_WRONLY, 0777)) < 0) {
- X perror("openshfdata");
- X printf("unable to open %s\n",SHIPFREEDATAFL);
- X***************
- X*** 350,357 ****
- X printf("ship #%u destroyed.\n", shipno);
- X /* write the ship # at the very end of SHIPFREEDATAFL */
- X fstat(fd,&buf);
- X Filewrite(fd,(char *)&shipno, sizeof(shipno), SHIPFREEDATAFL, buf.st_size );
- X!
- X }
- X
- X
- X--- 376,384 ----
- X printf("ship #%u destroyed.\n", shipno);
- X /* write the ship # at the very end of SHIPFREEDATAFL */
- X fstat(fd,&buf);
- X+ Locks(1);
- X Filewrite(fd,(char *)&shipno, sizeof(shipno), SHIPFREEDATAFL, buf.st_size );
- X! Locks(0);
- X }
- X
- X
- X***************
- X*** 369,371 ****
- X--- 396,403 ----
- X write(power_fd, (char *)p, sizeof(*p)*MAXPLAYERS );
- X close(power_fd);
- X }
- X+
- X+
- X+
- X+
- X+
- X*** ../../GB2/fire.c Thu Jul 6 07:19:21 1989
- X--- fire.c Fri Sep 15 07:28:03 1989
- X***************
- X*** 20,30 ****
- X int argn;
- X char args[MAXARGS][COMMANDSIZE];
- X {
- X! placetype from,to;
- X! planettype *fpl,*tpl;
- X sectortype *sect;
- X! int dam=0,dam2=0,strength,oldstrength,maxstrength,
- X i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0;
- X float dist;
- X char string[PLACENAMESIZE],buf[200];
- X char shoot_msg[1000], retal_msg[1000];
- X--- 20,32 ----
- X int argn;
- X char args[MAXARGS][COMMANDSIZE];
- X {
- X! placetype from,to,to2;
- X! planettype *fpl,*tpl,*tpl2;
- X sectortype *sect;
- X! int dam=0,dam2=0,dam3=0,
- X! strength,oldstrength,maxstrength,tostrength,to2strength,
- X i,from_firex= -1,from_firey= -1,firex= -1,firey= -1,Numplayersretaliate=0;
- X+ int sh;
- X float dist;
- X char string[PLACENAMESIZE],buf[200];
- X char shoot_msg[1000], retal_msg[1000];
- X***************
- X*** 53,58 ****
- X--- 55,62 ----
- X printf("usage: fire\n");
- X return;
- X }
- X+
- X+
- X if (from.level == LEVEL_UNIV || from.level == LEVEL_STAR) {
- X printf("You can't shoot from there.\n");
- X fire_handler();
- X***************
- X*** 129,137 ****
- X scanf("%35s",string);
- X } else sscanf(args[2],"%35s",string);
- X
- X- Locks(1);
- X to = Getplace(string,1);
- X- Locks(0);
- X
- X if (to.err)
- X fire_handler();
- X--- 133,139 ----
- X***************
- X*** 142,167 ****
- X if (from.shipno == to.shipno) {
- X printf("You can't do that.\n");
- X fire_handler();
- X! } else
- X! Locks(1); /* ship file will already be locked */
- X }
- X /* get ship again */
- X openshdata(&fire_toshdata);
- X free(to.shipptr);
- X (void)getship(fire_toshdata, &(to.shipptr), to.shipno);
- X- Locks(0);
- X
- X! if (to.shipptr->is_dead) {
- X printf("that ship has already been destroyed.\n");
- X fire_handler();
- X }
- X
- X if (to.shipptr->is_docked && to.shipptr->whatdest==LEVEL_PLAN) {
- X- Locks(1);
- X openpdata(&fire_topdata);
- X getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
- X close(fire_topdata);
- X- Locks(0);
- X }
- X
- X } else if (to.level==LEVEL_PLAN) {
- X--- 144,170 ----
- X if (from.shipno == to.shipno) {
- X printf("You can't do that.\n");
- X fire_handler();
- X! }
- X!
- X }
- X /* get ship again */
- X openshdata(&fire_toshdata);
- X free(to.shipptr);
- X (void)getship(fire_toshdata, &(to.shipptr), to.shipno);
- X
- X! if (!to.shipptr->is_alive) {
- X printf("that ship has already been destroyed.\n");
- X fire_handler();
- X }
- X
- X+ /* save defense attack strength for retaliation */
- X+ tostrength = MIN(to.shipptr->destruct,
- X+ Shipdata[to.shipptr->type][ABIL_GUNS]*(100-to.shipptr->damage)/100.);
- X+
- X if (to.shipptr->is_docked && to.shipptr->whatdest==LEVEL_PLAN) {
- X openpdata(&fire_topdata);
- X getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
- X close(fire_topdata);
- X }
- X
- X } else if (to.level==LEVEL_PLAN) {
- X***************
- X*** 171,178 ****
- X /* same planet as firing one */
- X sameplanet = 1;
- X tpl = fpl;
- X! } else
- X! Locks(1);
- X }
- X
- X if (!sameplanet) {
- X--- 174,180 ----
- X /* same planet as firing one */
- X sameplanet = 1;
- X tpl = fpl;
- X! }
- X }
- X
- X if (!sameplanet) {
- X***************
- X*** 179,185 ****
- X openpdata(&fire_topdata);
- X getplanet(fire_topdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
- X }
- X- Locks(0);
- X
- X /* ask user for sector of planet to shoot at */
- X printf("Aim at");
- X--- 181,186 ----
- X***************
- X*** 192,198 ****
- X }
- X
- X
- X! /* prompt if hes your ally */
- X if ( to.level==LEVEL_SHIP && isset(Race->allied, to.shipptr->owner) ) {
- X tty_on();
- X printf("Fire on your ally? (y/n)");
- X--- 193,199 ----
- X }
- X
- X
- X! /* prompt if he's your ally */
- X if ( to.level==LEVEL_SHIP && isset(Race->allied, to.shipptr->owner) ) {
- X tty_on();
- X printf("Fire on your ally? (y/n)");
- X***************
- X*** 213,236 ****
- X getchr();
- X } else sscanf(args[3],"%d",&strength);
- X if (strength>maxstrength) {
- X! printf("Too large.\n");
- X fire_handler();
- X- } else if (strength<=0) {
- X- printf("wimp.\n");
- X- fire_handler();
- X }
- X
- X /* block kill signals to foil cheaters */
- X mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
- X
- X dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, shoot_msg,
- X 1 ); /*1==get smap*/
- X! printf("Distance to target: %.0f, maximum distance: %d.\n",dist, SYSTEMSIZE);
- X if (dam < 0) {
- X printf("Target out of range!\n", SYSTEMSIZE);
- X fire_handler();
- X! }
- X
- X if (from.level==LEVEL_SHIP) {
- X from.shipptr->destruct -= strength;
- X from.shipptr->mass -= strength*MASS_DESTRUCT;
- X--- 214,271 ----
- X getchr();
- X } else sscanf(args[3],"%d",&strength);
- X if (strength>maxstrength) {
- X! strength = maxstrength;
- X! printf("set to strength %d\n",maxstrength);
- X! }
- X!
- X! if (strength<=0) {
- X! printf("no attack.\n");
- X fire_handler();
- X }
- X
- X /* block kill signals to foil cheaters */
- X mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
- X
- X+
- X dam = shoot(from,&to,fpl,tpl,firex,firey,strength, &dist, shoot_msg,
- X 1 ); /*1==get smap*/
- X! printf("Distance to target: %.0f, maximum distance: %d\n\n",dist, SYSTEMSIZE);
- X if (dam < 0) {
- X printf("Target out of range!\n", SYSTEMSIZE);
- X fire_handler();
- X! }
- X
- X+ printf("BO\007OM!!\n%s\n", shoot_msg);
- X+
- X+ teleg_add("",telegram_buf);
- X+ sprintf(buf," BULLETIN from %s\n\n",Dispplace(&from));
- X+ teleg_add(buf,telegram_buf);
- X+
- X+ if(from.level==LEVEL_SHIP)
- X+ sprintf(buf,"%s #%u ",Shipnames[from.shipptr->type],from.shipno);
- X+
- X+ if(from.level==LEVEL_PLAN)
- X+ sprintf(buf,"%s ", Dispplace(&from));
- X+
- X+ /* sprintf(buf,"%s%s ",from.level==LEVEL_SHIP ?
- X+ "%s ",Shipnames[from.shipptr->type] : "", Dispplace(&from)); */
- X+ teleg_add(buf,telegram_buf);
- X+ if (to.level==LEVEL_SHIP)
- X+ sprintf(buf,"fired on %s #%u @ %s;\n", Shipnames[to.shipptr->type],
- X+ to.shipno, prin_ship_orbits(to.shipptr));
- X+ else
- X+ sprintf(buf,"fired on planet %s;\n", Dispplace(&to));
- X+
- X+ teleg_add(buf,telegram_buf);
- X+ /* add telegram message */
- X+ teleg_add(shoot_msg, telegram_buf);
- X+
- X+ for (i=1; i<MAXPLAYERS; i++)
- X+ if (Nuked[i] && i!=Playernum)
- X+ teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
- X+
- X+
- X+
- X if (from.level==LEVEL_SHIP) {
- X from.shipptr->destruct -= strength;
- X from.shipptr->mass -= strength*MASS_DESTRUCT;
- X***************
- X*** 237,276 ****
- X } else if (from.level==LEVEL_PLAN)
- X fpl->info[Playernum-1].destruct -= strength;
- X
- X-
- X- /* enemy retaliates (if he can) */
- X-
- X strength = 0;
- X! if ( to.level==LEVEL_SHIP ) {
- X! strength = MIN(to.shipptr->destruct,Shipdata[to.shipptr->type][ABIL_GUNS] *(100-to.shipptr->damage)/100.);
- X!
- X to.shipptr->destruct -= strength;
- X to.shipptr->mass -= strength*MASS_DESTRUCT;
- X
- X! } else if (to.level==LEVEL_PLAN) { /* all players owning planet retal */
- X
- X! int strength2;
- X! oldstrength = strength;
- X strength = 0;
- X! for (i=1; i<MAXPLAYERS; i++)
- X! if (tpl->info[i-1].destruct>0 && i!=Playernum && Nuked[i]) {
- X! strength2 = MIN(oldstrength, tpl->info[i-1].destruct);
- X if (strength2 > PLAN_FIRE_LIM)
- X strength2 = PLAN_FIRE_LIM;
- X tpl->info[i-1].destruct -= strength2;
- X! strength += strength2;
- X Numplayersretaliate++;
- X! printf("Player %d returns fire, strength %d.\n", i, strength2);
- X }
- X }
- X
- X- /* enemy fires at shooting sector */
- X- if ( !(to.level==LEVEL_SHIP && to.shipptr->is_dead) )
- X dam2=0;
- X- if(strength>0)dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist,
- X- retal_msg, 1);
- X
- X
- X if (from.level==LEVEL_PLAN) {
- X putplanet(fire_frompdata,fpl,Stars[from.snum]->planetpos[from.pnum]);
- X close(fire_frompdata);
- X--- 272,397 ----
- X } else if (from.level==LEVEL_PLAN)
- X fpl->info[Playernum-1].destruct -= strength;
- X
- X strength = 0;
- X! if ( to.level==LEVEL_SHIP && dist <= 400. && !to.shipptr->rad) {
- X! strength = tostrength;
- X to.shipptr->destruct -= strength;
- X to.shipptr->mass -= strength*MASS_DESTRUCT;
- X
- X! } else if (to.level==LEVEL_PLAN && dist<= 400.) {
- X! /* all players owning planet retal. do not retaliate at long distances
- X! since it is 'unrealistic' and easy to drain defences */
- X
- X! int strength0, strength1, strength2, sh;
- X!
- X strength = 0;
- X! for (i=1; i<= Numraces(); i++)
- X! if (i!=Playernum && tpl->info[i-1].numsectsowned) {
- X! strength0 = 0;
- X! strength1 = 0;
- X! strength2 = 0;
- X! /* all aliens races which inhabit the planet fire their ships at the
- X! attacker as defensive support */
- X! openshdata(&fire_toshdata);
- X! /* go through liked list of ships
- X! orbiting the planet */
- X! sh = tpl->ships;
- X!
- X! while (sh) {
- X!
- X! free(to.shipptr);
- X! (void)getship(fire_toshdata, &(to.shipptr), sh);
- X! if(to.shipptr->owner == i && !to.shipptr->rad) {
- X!
- X! strength0 = MIN(to.shipptr->destruct,
- X! Shipdata[to.shipptr->type][ABIL_GUNS]*(100-to.shipptr->damage)/100.);
- X! strength1 += strength0;
- X! to.shipptr->destruct -= strength0;
- X! putship(fire_toshdata, to.shipptr, sh);
- X!
- X! }
- X! sh = to.shipptr->nextship;
- X! }
- X! close(fire_toshdata);
- X!
- X! /* add planet defense strength */
- X!
- X! strength2 = tpl->info[i-1].destruct;
- X if (strength2 > PLAN_FIRE_LIM)
- X strength2 = PLAN_FIRE_LIM;
- X tpl->info[i-1].destruct -= strength2;
- X!
- X! strength += strength1;
- X! strength += strength2;
- X Numplayersretaliate++;
- X! if(strength1)printf("Player %d ships returns fire, total strength %d.\n", i, strength1);
- X! if(strength2)printf("Planet returns fire with strength %d\n\n", strength2);
- X }
- X }
- X
- X dam2=0;
- X
- X+ if(strength>0)dam2 = shoot(to,&from,tpl,fpl,from_firex,from_firey,strength, &dist, retal_msg, 1);
- X
- X+
- X+ if (tostrength > 0) {
- X+ printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to),
- X+ Numplayersretaliate>1 ? "total " : "", strength, dam2);
- X+ puts(retal_msg);
- X+
- X+ } else printf("%s cannot retaliate.\n",Dispplace(&to) );
- X+
- X+ /* protecting ships retaliate individually - ship-to-ship combat only */
- X+ if(to.level==LEVEL_SHIP && from.level==LEVEL_SHIP) {
- X+
- X+ if(to.shipptr->whatorbits==LEVEL_STAR) /* star level ships */
- X+ sh = Stars[to.shipptr->storbits]->ships;
- X+ if(to.shipptr->whatorbits==LEVEL_PLAN) /* planet level ships */
- X+ {
- X+ openpdata(&fire_frompdata);
- X+ getplanet(fire_frompdata,&tpl,Stars[to.snum]->planetpos[to.pnum]);
- X+ close(fire_frompdata);
- X+ sh = tpl->ships;
- X+ }
- X+
- X+ while (sh && from.shipptr->is_alive)
- X+ {
- X+ sprintf(string,"#%d",sh);
- X+ to2 = Getplace(string,1);
- X+
- X+ if(sh != from.shipno)
- X+ {
- X+
- X+ if(to2.shipptr->is_alive && !to2.shipptr->rad
- X+ && to2.shipptr->protect.on
- X+ && (to2.shipptr->protect.ship == to.shipno) )
- X+ {
- X+ to2strength = MIN(to2.shipptr->destruct,
- X+ Shipdata[to2.shipptr->type][ABIL_GUNS]*(100-to2.shipptr->damage)/100.);
- X+ to2.shipptr->destruct -= to2strength;
- X+ to2.shipptr->mass -= strength*MASS_DESTRUCT;
- X+ if(to2strength>0)
- X+ {
- X+ dam3 = shoot(to2,&from,tpl,fpl,from_firex,from_firey,to2strength, &dist, retal_msg, 1);
- X+
- X+ if (to2strength > 0) {
- X+ printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to2),
- X+ Numplayersretaliate>1 ? "total " : "", to2strength, dam3);
- X+ puts(retal_msg);
- X+
- X+ } else printf("%s cannot retaliate.\n",Dispplace(&to) );
- X+
- X+ }
- X+ putship(fire_toshdata,to2.shipptr,to2.shipno);
- X+ }
- X+
- X+ }
- X+ sh = to2.shipptr->nextship;
- X+
- X+ }
- X+ }
- X+
- X+
- X if (from.level==LEVEL_PLAN) {
- X putplanet(fire_frompdata,fpl,Stars[from.snum]->planetpos[from.pnum]);
- X close(fire_frompdata);
- X***************
- X*** 292,327 ****
- X
- X
- X
- X- printf("BO\007OM!!\n%s", shoot_msg);
- X
- X- teleg_add("",telegram_buf);
- X- sprintf(buf," BULLETIN from %s\n\n",Dispplace(&from));
- X- teleg_add(buf,telegram_buf);
- X- sprintf(buf,"%s%s ",from.level==LEVEL_SHIP ? "ship " : "", Dispplace(&from));
- X- teleg_add(buf,telegram_buf);
- X- if (to.level==LEVEL_SHIP)
- X- sprintf(buf,"fired on ship #%u @ %s;\n", to.shipno,
- X- prin_ship_orbits(to.shipptr));
- X- else
- X- sprintf(buf,"fired on planet %s;\n", Dispplace(&to));
- X
- X- teleg_add(buf,telegram_buf);
- X- /* add telegram message */
- X- teleg_add(shoot_msg, telegram_buf);
- X-
- X- for (i=1; i<MAXPLAYERS; i++)
- X- if (Nuked[i] && i!=Playernum)
- X- teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
- X-
- X-
- X- if (dam2 > 0) {
- X- printf("%s retaliates with %sstrength %d!!\n", Dispplace(&to),
- X- Numplayersretaliate>1 ? "total " : "", strength, dam2);
- X- puts(retal_msg);
- X-
- X- } else printf("%s cannot retaliate.\n",Dispplace(&to) );
- X-
- X-
- X if (from.level==LEVEL_PLAN) {
- X /* firing from planet -- deduct APs from that star */
- X deductAPs(APcount, from.snum, 0);
- X--- 413,420 ----
- X***************
- X*** 338,343 ****
- X--- 431,437 ----
- X
- X
- X sigsetmask(mask); /* reset mask */
- X+
- X
- X }
- X
- X*** ../../GB2/fix.c Wed Jul 5 15:15:22 1989
- X--- fix.c Fri Sep 15 07:28:04 1989
- X***************
- X*** 53,59 ****
- X--- 53,62 ----
- X query(FLOAT,"adventurists",&Race->nonhomebodies,0,0,0,0);
- X query(FLOAT,"metabolism",&Race->metabolism,0,0,0,0);
- X query(FLOAT,"overbirthrate",&Race->overbirthrate,0,0,0,0);
- X+
- X query(INT, "Playernum",0,&Race->Playernum,0,0,0);
- X+ query(CHAR, "defsystem",0,0,&Race->defsystem,0,0);
- X+ query(CHAR, "defplanetnum",0,0,&Race->defplanetnum,0,0);
- X query(CHAR, "fighters",0,0,&Race->fighters,0,0);
- X query(CHAR, "IQ",0,0,&Race->IQ,0,0);
- X query(CHAR, "# sexes",0,0,&Race->number_sexes,0,0);
- X***************
- X*** 74,81 ****
- X query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
- X query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
- X query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
- X! if (fix_mod)
- X! putrace(Race);
- X } else {
- X
- X switch (Dir.level) {
- X--- 77,85 ----
- X query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
- X query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
- X query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
- X! if (fix_mod){
- X! printf("saving");
- X! putrace(Race);}
- X } else {
- X
- X switch (Dir.level) {
- X***************
- X*** 117,122 ****
- X--- 121,127 ----
- X setbit(Stars[Dir.snum]->explored, Playernum);
- X ch = !!isset(Stars[Dir.snum]->inhabited, Playernum);
- X query(CHAR, "inhabited",0,0,&ch,0,0);
- X+
- X if (ch)
- X setbit(Stars[Dir.snum]->inhabited, Playernum);
- X ch = Stars[Dir.snum]->nova_stage;
- X***************
- X*** 265,270 ****
- X--- 270,280 ----
- X ch = sh->owner;
- X query(CHAR, "owner",0,0,&ch,0,0);
- X sh->owner = ch;
- X+
- X+ unl = sh->type;
- X+ query(LONG, "type",0,0,0,0,&unl);
- X+ sh->type = unl;
- X+
- X query(FLOAT,"x position",&sh->xpos,0,0,0,0);
- X query(FLOAT,"y position",&sh->ypos,0,0,0,0);
- X query(FLOAT,"mass",&sh->mass,0,0,0,0);
- X***************
- X*** 283,288 ****
- X--- 293,299 ----
- X unl = sh->rad;
- X query(LONG, "irradiated",0,0,0,0,&unl);
- X sh->rad = unl;
- X+
- X unl = sh->damage;
- X query(LONG, "damage",0,0,0,0,&unl);
- X sh->damage = unl;
- X***************
- X*** 302,310 ****
- X query(CHAR, "what planet dest",0,0,&ch,0,0);
- X sh->destpnum = ch;
- X query(SHORT, "what ship dest",0,0,0,&sh->destshipno,0);
- X! ch = sh->is_dead;
- X! query(CHAR, "is dead",0,0,&ch,0,0);
- X! sh->is_dead = !!ch;
- X ch = sh->notified;
- X query(CHAR, "notified",0,0,&ch,0,0);
- X sh->notified = !!ch;
- X--- 313,321 ----
- X query(CHAR, "what planet dest",0,0,&ch,0,0);
- X sh->destpnum = ch;
- X query(SHORT, "what ship dest",0,0,0,&sh->destshipno,0);
- X! ch = sh->is_alive;
- X! query(CHAR, "is alive",0,0,&ch,0,0);
- X! sh->is_alive = !!ch;
- X ch = sh->notified;
- X query(CHAR, "notified",0,0,&ch,0,0);
- X sh->notified = !!ch;
- X***************
- X*** 321,331 ****
- X query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
- X query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
- X
- X! if (is_object(sh)) {
- X! query(SHORT, "object:number",0,0,0,&sh->orders.object.number,0);
- X! query(SHORT, "object:number2",0,0,0,&sh->orders.object.number2,0);
- X! }
- X
- X if (fix_mod) {
- X printf("Saving...\n");
- X putship(fix_shdata, sh, Dir.shipno);
- X--- 332,343 ----
- X query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
- X query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
- X
- X! query(SHORT, "object:number",0,0,0,&sh->object.number,0);
- X! query(SHORT, "object:number2",0,0,0,&sh->object.number2,0);
- X! query(SHORT, "object:number3",0,0,0,&sh->object.number3,0);
- X! query(SHORT, "object:number4",0,0,0,&sh->object.number4,0);
- X
- X+
- X if (fix_mod) {
- X printf("Saving...\n");
- X putship(fix_shdata, sh, Dir.shipno);
- X***************
- X*** 332,348 ****
- X }
- X close(fix_shdata);
- X break;
- X-
- X-
- X- /*ordertype orders; /* standing orders for ship */
- X- /*unsigned augmented : 4; /* # of times augmented (max 10) */
- X- /*unsigned whatdest : 2; /* where going (same as Dir) */
- X- /*unsigned whatorbits : 2; /* where orbited (same as Dir) */
- X- /*unsigned type : 4; /* what type ship is */
- X- /*unsigned is_sheep : 1; /* 1 bit: is under influence of mind control */
- X- /*unsigned is_docked : 1; /* 1 bit: is landed on a planet or docked */
- X- /*unsigned has_moved : 1; /* 1 bit: has been moved by user */
- X- /*unsigned outtafuel_notified:1; /* 1bit: has been notified of no fuel */
- X
- X
- X }
- X--- 344,349 ----
- X*** ../../GB2/getplace.c Wed Jul 5 15:15:24 1989
- X--- getplace.c Fri Sep 15 07:28:07 1989
- X***************
- X*** 32,51 ****
- X case '#':
- X sscanf(++string,"%hd",&where.shipno);
- X openshdata(&getplace_shdata);
- X- Locks(1);
- X if (!getship(getplace_shdata,&where.shipptr,where.shipno)) {
- X- Locks(0);
- X close(getplace_shdata);
- X DontOwnErr(where.shipno);
- X where.err = 1;
- X return where;
- X }
- X- Locks(0);
- X close(getplace_shdata);
- X if ( (where.shipptr->owner==Playernum || ignoreexpl || God)
- X! && (!where.shipptr->is_dead || God)) {
- X! if (where.shipptr->is_dead)
- X! printf("Ship is dead.\n");
- X where.level = LEVEL_SHIP;
- X where.snum = where.shipptr->storbits;
- X where.pnum = where.shipptr->pnumorbits;
- X--- 32,48 ----
- X case '#':
- X sscanf(++string,"%hd",&where.shipno);
- X openshdata(&getplace_shdata);
- X if (!getship(getplace_shdata,&where.shipptr,where.shipno)) {
- X close(getplace_shdata);
- X DontOwnErr(where.shipno);
- X where.err = 1;
- X return where;
- X }
- X close(getplace_shdata);
- X if ( (where.shipptr->owner==Playernum || ignoreexpl || God)
- X! && (where.shipptr->is_alive || God)) {
- X! /* if (!where.shipptr->is_alive)
- X! printf("Ship is dead.\n"); */
- X where.level = LEVEL_SHIP;
- X where.snum = where.shipptr->storbits;
- X where.pnum = where.shipptr->pnumorbits;
- X***************
- X*** 58,64 ****
- X return where;
- X } else {
- X where.err = 1;
- X! if (where.shipptr->is_dead)
- X printf("That ship has been destroyed.\n");
- X else
- X DontOwnErr(where.shipno);
- X--- 55,61 ----
- X return where;
- X } else {
- X where.err = 1;
- X! if (!where.shipptr->is_alive)
- X printf("That ship has been destroyed.\n");
- X else
- X DontOwnErr(where.shipno);
- X***************
- X*** 159,168 ****
- X if (!strncmp(substr,Stars[where->snum]->pnames[i],l)) {
- X where->level=LEVEL_PLAN;
- X where->pnum = i;
- X- Locks(1);
- X openpdata(&getplace2_pdata);
- X getplanet(getplace2_pdata, &p, Stars[where->snum]->planetpos[i]);
- X- Locks(0);
- X close(getplace2_pdata);
- X if (ignoreexpl || p->info[Playernum-1].explored || God) {
- X free(p);
- X--- 156,163 ----
- X***************
- X*** 221,227 ****
- X {
- X reg int r=0;
- X
- X! if (s->is_dead) {
- X printf("%s #%d has been destroyed.\n", Shipnames[s->type], n);
- X r = 1;
- X } else if (s->owner!=Playernum) {
- X--- 216,222 ----
- X {
- X reg int r=0;
- X
- X! if (!s->is_alive) {
- X printf("%s #%d has been destroyed.\n", Shipnames[s->type], n);
- X r = 1;
- X } else if (s->owner!=Playernum) {
- X*** ../../GB2/help.c Wed Jul 5 15:15:25 1989
- X--- help.c Fri Sep 15 07:28:07 1989
- X***************
- X*** 1,4 ****
- X-
- X /*
- X * Galactic Bloodshed (Robert Chansky, smq@b)
- X * help.c -- help on certain topics
- X--- 1,3 ----
- X*** ../../GB2/land.c Thu Jul 6 07:19:44 1989
- X--- land.c Fri Sep 15 07:28:09 1989
- X***************
- X*** 15,20 ****
- X--- 15,21 ----
- X #include <signal.h>
- X
- X int land_sectdata,land_shdata,land_pdata;
- X+ int land_stdata;
- X extern char telegram_buf[AUTO_TELEG_SIZE];
- X
- X
- X***************
- X*** 26,37 ****
- X {
- X int land_handler();
- X char c;
- X! shiptype *s,*s2;
- X planettype *p;
- X sectortype *sect;
- X placetype where;
- X bool dock,cont,planetmod=0,sectmod=0;
- X int numdest=0,ship2no,shipno,x= -1,y= -1,i,mask;
- X float fuel;
- X double Dist;
- X char buf[200];
- X--- 27,39 ----
- X {
- X int land_handler();
- X char c;
- X! shiptype *s,*s2,*s3;
- X planettype *p;
- X sectortype *sect;
- X placetype where;
- X bool dock,cont,planetmod=0,sectmod=0;
- X int numdest=0,ship2no,shipno,x= -1,y= -1,i,mask;
- X+ int sh, sh3;
- X float fuel;
- X double Dist;
- X char buf[200];
- X***************
- X*** 88,99 ****
- X
- X printf("dock %s #%d with what ship #", Shipnames[s->type], shipno);
- X scanf("%d", &ship2no);
- X- Locks(1);
- X if (!getship(land_shdata, &s2, ship2no))
- X land_handler();
- X- Locks(0);
- X
- X! if (s2->is_docked) {
- X printf("ship #%d is already docked.\n",ship2no);
- X land_handler();
- X }
- X--- 90,101 ----
- X
- X printf("dock %s #%d with what ship #", Shipnames[s->type], shipno);
- X scanf("%d", &ship2no);
- X if (!getship(land_shdata, &s2, ship2no))
- X land_handler();
- X
- X! if ( !(s->type == STYPE_FIGHTER && s2->type == STYPE_CARRIER) )
- X! {
- X! if (s2->is_docked) {
- X printf("ship #%d is already docked.\n",ship2no);
- X land_handler();
- X }
- X***************
- X*** 117,132 ****
- X s->is_docked = 1;
- X s->whatdest = LEVEL_SHIP;
- X s->destshipno = ship2no;
- X! s->xpos = s2->xpos + 1.0;
- X! s->ypos = s2->ypos;
- X
- X s2->is_docked = 1;
- X s2->whatdest = LEVEL_SHIP;
- X s2->destshipno = shipno;
- X putship(land_shdata, s2, ship2no);
- X
- X printf("ship #%d docked with ship #%d.\n",shipno, ship2no);
- X
- X } else { /* docking with a planet */
- X
- X if (assault && s->popn < 1) {
- X--- 119,210 ----
- X s->is_docked = 1;
- X s->whatdest = LEVEL_SHIP;
- X s->destshipno = ship2no;
- X! s->xpos = s2->xpos+int_rand(-1,1);
- X! s->ypos = s2->ypos+int_rand(-1,1);
- X
- X s2->is_docked = 1;
- X s2->whatdest = LEVEL_SHIP;
- X s2->destshipno = shipno;
- X+
- X+ putship(land_shdata, s, shipno);
- X putship(land_shdata, s2, ship2no);
- X
- X printf("ship #%d docked with ship #%d.\n",shipno, ship2no);
- X+ } else {
- X+ /* docking fighters with a carrier */
- X
- X+ if(s->whatorbits==LEVEL_PLAN)
- X+ {
- X+ openpdata(&land_pdata);
- X+ getplanet(land_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
- X+
- X+ sh = p->ships;
- X+ if(sh == shipno){
- X+ p->ships = s->nextship;
- X+ putplanet(land_pdata, p, Stars[s->storbits]->planetpos[s->pnumorbits]);
- X+ } else {
- X+ while(sh != shipno){
- X+
- X+ getship(land_shdata, &s3, sh);
- X+
- X+ sh3 = sh;
- X+ sh = s3->nextship;
- X+ }
- X+ s3->nextship = s->nextship;
- X+ if(sh3 == ship2no)s2->nextship = s3->nextship;
- X+ putship(land_shdata, s3, sh3);
- X+
- X+ }
- X+ }
- X+
- X+
- X+ if(s->whatorbits==LEVEL_STAR)
- X+ {
- X+ openpdata(&land_stdata);
- X+ getsdata(land_stdata, &Stars[s->storbits], s->storbits);
- X+
- X+ sh = Stars[s->storbits]->ships;
- X+ if(sh == shipno){
- X+ Stars[s->storbits]->ships = s->nextship;
- X+ putstar(land_stdata, Stars[s->storbits], s->storbits);
- X+ close(land_stdata);
- X+ } else {
- X+
- X+ while(sh != shipno){
- X+ getship(land_shdata, &s3, sh);
- X+ sh3 = sh;
- X+ sh = s3->nextship;
- X+ }
- X+ s3->nextship = s->nextship;
- X+ if(sh3 == ship2no)s2->nextship = s3->nextship;
- X+
- X+ putship(land_shdata, s3, sh3);
- X+
- X+ }
- X+ }
- X+
- X+
- X+ s->fuel -= fuel;
- X+ s->mass -= fuel * MASS_FUEL;
- X+ s->is_docked = 1;
- X+ s->whatdest = LEVEL_SHIP;
- X+ s->destshipno = ship2no;
- X+ s->nextship = 0;
- X+
- X+ s->xpos = s2->xpos;
- X+ s->ypos = s2->ypos;
- X+
- X+ s->object.number = s2->object.number;
- X+ s->object.number4 = 1; /* docked with carrier */
- X+
- X+ s2->object.number = shipno;
- X+ s2->object.number4 += 1; /* number of fighters docked */
- X+ s2->mass += s->mass;
- X+ /* remove fighter from upper level linked list */
- X+ putship(land_shdata, s, shipno);
- X+ putship(land_shdata, s2, ship2no);
- X+ }
- X+
- X } else { /* docking with a planet */
- X
- X if (assault && s->popn < 1) {
- X***************
- X*** 174,180 ****
- X GetMapSector(p, &x, &y);
- X opensectdata(&land_sectdata);
- X getsector(land_sectdata,§,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
- X! if (Race->likes[sect->des] == 0.0) {
- X printf("The ship is not built to land on that sector.\n");
- X cont = 0;
- X exit(0);
- X--- 252,258 ----
- X GetMapSector(p, &x, &y);
- X opensectdata(&land_sectdata);
- X getsector(land_sectdata,§,p->sectormappos+(y*p->Maxx+x)*sizeof(sectortype));
- X! if (Race->likes[sect->des] == 0.0 && !sect->is_wasted) {
- X printf("The ship is not built to land on that sector.\n");
- X cont = 0;
- X exit(0);
- X*** ../../GB2/launch.c Wed Jul 5 15:15:28 1989
- X--- launch.c Fri Sep 15 07:28:10 1989
- X***************
- X*** 9,15 ****
- X extern jmp_buf main_jenv;
- X #include <signal.h>
- X
- X! int launch_shdata,launch_pdata;
- X
- X
- X launch(APcount, argn,args)
- X--- 9,15 ----
- X extern jmp_buf main_jenv;
- X #include <signal.h>
- X
- X! int launch_shdata,launch_pdata,launch_stdata;
- X
- X
- X launch(APcount, argn,args)
- X***************
- X*** 18,24 ****
- X char args[MAXARGS][COMMANDSIZE];
- X {
- X int launch_handler();
- X! shiptype *s,*s2;
- X planettype *p;
- X bool planet=0;
- X int shipno;
- X--- 18,25 ----
- X char args[MAXARGS][COMMANDSIZE];
- X {
- X int launch_handler();
- X! int sh, sh2, sh3;
- X! shiptype *s,*s2,*s3;
- X planettype *p;
- X bool planet=0;
- X int shipno;
- X***************
- X*** 62,68 ****
- X
- X if (s->whatdest==LEVEL_SHIP) {
- X
- X! if (s->whatorbits==LEVEL_UNIV) {
- X if (!enufAP(Sdata.AP, APcount))
- X launch_handler();
- X else
- X--- 63,71 ----
- X
- X if (s->whatdest==LEVEL_SHIP) {
- X
- X! (void)getship(launch_shdata, &s2, s->destshipno);
- X!
- X! if (s2->whatorbits==LEVEL_UNIV) {
- X if (!enufAP(Sdata.AP, APcount))
- X launch_handler();
- X else
- X***************
- X*** 73,93 ****
- X else
- X deductAPs(APcount, s->storbits, 0);
- X }
- X! Locks(1);
- X! (void)getship(launch_shdata, &s2, s->destshipno);
- X! Locks(0);
- X s->is_docked = 0;
- X! s->whatdest = LEVEL_UNIV; /* no destination */
- X putship(launch_shdata, s, shipno);
- X s2->is_docked = 0;
- X s2->whatdest = LEVEL_UNIV;
- X! putship(launch_shdata, s2, s->destshipno);
- X close(launch_shdata);
- X free(s);
- X free(s2);
- X! printf("%s #%d undocked from ship #%d.\n",
- X! Shipnames[s->type], shipno, s->destshipno);
- X
- X } else {
- X if (!enufAP(Stars[s->storbits]->AP, APcount))
- X launch_handler();
- X--- 76,170 ----
- X else
- X deductAPs(APcount, s->storbits, 0);
- X }
- X!
- X! if( !(s->type == STYPE_FIGHTER && s2->type == STYPE_CARRIER) )
- X! {
- X s->is_docked = 0;
- X! s->whatdest = LEVEL_UNIV;
- X! sh2 = s->destshipno;
- X! s->destshipno = 0;
- X putship(launch_shdata, s, shipno);
- X+
- X s2->is_docked = 0;
- X s2->whatdest = LEVEL_UNIV;
- X! s2->destshipno = 0;
- X! putship(launch_shdata, s2, sh2);
- X close(launch_shdata);
- X free(s);
- X free(s2);
- X! } else { /* fighters docked with carriers */
- X
- X+ /* fix carrier linked list */
- X+ printf("%d %d \n\n",s2->object.number,shipno);
- X+ sh = s2->object.number;
- X+ printf("%d %d \n\n",sh,shipno);
- X+ if(sh == shipno) {
- X+ s2->object.number = s->object.number;
- X+ } else {
- X+
- X+ while(sh != shipno) {
- X+
- X+ printf("%d %d \n",sh,shipno);
- X+ (void)getship(launch_shdata, &s3, sh);
- X+ sh3 = sh;
- X+ sh = s3->object.number;
- X+ }
- X+
- X+ s3->object.number = s->object.number; /* change pointer */
- X+ putship(launch_shdata, s3, sh3);
- X+ }
- X+
- X+ /* fighter is on its own */
- X+ s->is_docked = 0;
- X+ s->whatdest = LEVEL_UNIV;
- X+ s->whatorbits = s2->whatorbits;
- X+ s->object.number = 0;
- X+ s->object.number4 = 0;
- X+ sh2 = s->destshipno;
- X+ s->destshipno = 0;
- X+
- X+ s->xpos = s2->xpos+1;
- X+ s->ypos = s2->ypos;
- X+ s->storbits = s2->storbits;
- X+ s->pnumorbits = s2->pnumorbits;
- X+
- X+ s2->mass -= s->mass; /* carrier is lighter */
- X+ s2->object.number4 -= 1;
- X+ /* put fighter into the appropriate linked list (planet/star/universe).
- X+ it is put into the level of the carrier */
- X+
- X+ if(s->whatorbits==LEVEL_PLAN)
- X+ {
- X+ openpdata(&launch_pdata);
- X+ getplanet(launch_pdata, &p, Stars[s->storbits]->planetpos[s->pnumorbits]);
- X+ s->nextship = p->ships;
- X+ p->ships = shipno;
- X+ putplanet(launch_pdata,p,Stars[s->storbits]->planetpos[s->pnumorbits]);
- X+ close(launch_pdata);
- X+ }
- X+ if(s->whatorbits==LEVEL_STAR)
- X+ {
- X+ openstardata(&launch_stdata);
- X+ getsdata(launch_stdata, &Stars[s->storbits],s->storbits);
- X+ s->nextship = Stars[s->storbits]->ships;
- X+ Stars[s->storbits]->ships = shipno;
- X+ putstar(launch_stdata, Stars[s->storbits],s->storbits);
- X+ close(launch_stdata);
- X+ }
- X+
- X+ putship(launch_shdata, s, shipno);
- X+ putship(launch_shdata, s2, sh2);
- X+ close(launch_shdata);
- X+
- X+ }
- X+
- X+
- X+ printf("%s #%d undocked from %s #%d.\n",
- X+ Shipnames[s->type], shipno, Shipnames[s2->type],sh2);
- X+
- X+ free(s);
- X+ free(s2);
- X+
- X } else {
- X if (!enufAP(Stars[s->storbits]->AP, APcount))
- X launch_handler();
- X***************
- X*** 123,129 ****
- X
- X
- X if (s->type == OTYPE_CANIST)
- X! s->orders.object.number = 20; /* canister dissapates after 20 turns */
- X
- X s->notified = 0;
- X putship(launch_shdata, s, shipno);
- X--- 200,206 ----
- X
- X
- X if (s->type == OTYPE_CANIST)
- X! s->object.number = 20; /* canister dissapates after 20 turns */
- X
- X s->notified = 0;
- X putship(launch_shdata, s, shipno);
- END_OF_FILE
- if test 52681 -ne `wc -c <'patches01b'`; then
- echo shar: \"'patches01b'\" unpacked with wrong size!
- fi
- # end of 'patches01b'
- fi
- echo shar: End of archive 2 \(of 4\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-